package com.leyou.item.service;

import com.leyou.common.exception.LyException;
import com.leyou.common.exception.enums.ExceptionEnum;
import org.springframework.stereotype.Service;

/**
 * @author LT
 * @version 1.0.0
 * @ClassName ItemService.java
 * @Description TODO 模拟的service
 * @createTime 2020年04月29日 15:47:00
 */
@Service
public class ItemService {

    public Long saveItem(Long id) {
        // 模拟添加操作，如果Id为1就抛异常
        if (id.equals(1L)) {
            throw new LyException(ExceptionEnum.INSERT_OPERATION_FAIL);
        }
        return id;
    }
}
